package com.chub;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

/**
 * @author : chub
 * @version : V1.0.0
 * @fileName : RespEnum.java
 * @description : 常用结果枚举类
 * @createTime : 2023-10-17 17:28
 */
@Getter
@AllArgsConstructor
public enum RespEnum {
    //==================== 登录相关枚举 ======================
    USER_LOGIN_TIME_OUT       (100, "登陆超时"),
    USER_NOT_LOGIN            (101, "用户未登录，请先进行登录"),
    ACCOUNT_IS_DISABLED       (102, "账户被禁用，请联系管理员解决"),
    USER_INFO_LOAD_FAIL       (103, "用户信息加载失败"),
    USER_IDENTITY_LOAD_FAIL   (104, "用户身份信息获取失败"),
    USERNAME_CAN_NOT_BE_EMPTY (105, "用户名不能为空"),
    USERNAME_OR_PASSWORD_ERROR(106, "用户名或密码错误"),
    USER_LOGIN_SUCCESS        (108, "用户登录成功"),
    USER_LOGOUT_SUCCESS       (109, "用户注销成功"),

    //==================== 注册相关枚举 ======================
    CAPTCHA_ERROR             (300, "验证码错误"),
    CAPTCHA_ALREADY_EXPIRE    (301, "验证码已过期"),
    USERNAME_ALREADY_EXISTED  (302, "用户名已存在"),
    PARAMETER_VALID_ERROR     (600, "参数格式不合法"),

    //======================= 其他枚举 ==============================
    PERMISSION_NOT_DEFINED    (403, "您没有操作权限"),
    OPERATOR_IS_SUCCESS       (200, "操作成功"),
    OPERATOR_IS_FAILED        (500, "操作失败"),
    UNKNOWN_ERROR             (600, "未知异常"),
    PARAM_ERROR               (700, "参数错误"),
    NULL_POINT                (800, "空指针异常"),

    HTTP_CLIENT_ERROR         (900, "HTTP客户端异常");





    /**
     * 状态码
     */
    private final Integer code;
    /**
     * 返回信息
     */
    private final String message;
}
